<include file="Public/HOME/HTML/head_html_5.html" />
<meta charset="utf-8"/>
<title>发布活动{$Think.const.TITLE}</title>
<link rel="stylesheet" type="text/css" href="/world/public/fontAwesome/css/font-awesome.min.css">
<include file="Public/ADMIN/HTML/Admin_header/admin_css_and_js.html" />
<include file="Public/ADMIN/HTML/Admin_header/admin_title.html" />
<include file="Public/ADMIN/HTML/Admin_header/admin_middle_list.html" />
<!-- 配置文件 -->
<js
	href="{$Think.const.DOMAIN_NAME}Public/Ueditor/ueditor/ueditor.config.js" />
<js
	href="{$Think.const.DOMAIN_NAME}Public/Ueditor/ueditor/ueditor.all.min.js" />
<script>
                            $(function(){
                                var ue = UE.getEditor('intro',{
                                    serverUrl :'{:U('Admin/Index/ueditor')}'
                                });
                            })                
</script>
 <div class="container-fluid main-content">
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <!-- <div class="widget"> -->
        <div class="widget-container fluid-height clearfix">
           		<div class="heading">
					<i class="icon-tags"></i>活动详情
				</div>
            <div class="widget-body">
                <div id="horizontal-form">
                        <!-- 111111111111111111111111111111111 -->
                        <div class="tabbable">
                            <ul id="myTab11" class="nav nav-tabs tabs-flat" style="padding:20px 80px 0px 80px;">
                                <li class="active">
                                    <a href="#home11" data-toggle="tab">
                                        活动详情
                                    </a>
                                </li>
                                <li class="">
                                    <a href="#profile11" data-toggle="tab">
                                        学生名单
                                    </a>
                                </li>
                                  <li class="">
                                    <a href="#profile12" data-toggle="tab">
                                        活动结果
                                    </a>
                                </li>
                            </ul>
                            <div class="tab-content tabs-flat">
                                <div class="tab-pane active" id="home11">

                               		<div class="col-md-12" >
                               			<div style="width: 80%;margin:10px auto">
									<p style="font-size: 24px; color: #007aff; text-align: center; font-family: 微软雅黑, 宋体;">
										{$list.aname}</p>
										<blockquote style="height: 40px;margin: 30px 0 0 0; color: #468847;font-size:16px">
											<address >
										    <span class="meta-author" >活动时间：{$list.startdate}</span>&nbsp;&nbsp;
											<span class="meta-author" >活动地点：{$list.place}</span>&nbsp;&nbsp;
											<span class="meta-author" >票数/剩余票数：{$list.totalticket}/{$list.restticket}</span>&nbsp;&nbsp;
											<span> 附件：<a href="http://localhost/world/{$list.thumb}">{$list.attach}</a></span>
											</address>
										</blockquote>
									<div class="blog-content" >
									<div class="as" ">&nbsp;&nbsp;<span style=" text-align: center;">{$list.content}</span></div>
								
											<!-- /.blog-content -->
												</div>
											<!-- /.post-blog -->
										</div>
									</div>
                                </div>

                                <div class="tab-pane" id="profile11">
                                <div class="row" style="height: 80%">
									<div class="col-lg-12" >
										<div style="width:90%;margin:0 auto;">
										<div class="widget-container fluid-height clearfix">
											<div class="widget-content padded clearfix">
												<table class="table table-bordered table-striped dataTable"
													id="datatable-editable">
													<thead>
														<th style="width: 8%; text-align: center">编号</th>
														<th style="width: 10%; text-align: center">学号</th>
														<th style="width: 10%; text-align: center;">姓名</th>
														<th style="width: 15%; text-align: center">活动分数</th>
														<th style="width: 10%; text-align: center;" class="sorting" role="columnheader" tabindex="0" aria-controls="datatable-editable" rowspan="1" colspan="1">出勤状态</th>
														<th style="width: 10%; text-align: center;">操作</th>
													</thead>
													
													<tbody>
														<assign name="number" value="1" />
														<assign name="project_not_through_id" value="100000" />
														<volist name="stu" id="vo">
														<tr>
															<td style="text-align: center;">{$number++}</td>
															<td style="text-align: center;">{$vo.stunum}</td>
															<td style="text-align: center;">{$vo.realname}</td>
															<td style="text-align: center;">{$vo.score}</td>
															<td style="text-align: center;"><span class="label label-primary">{$vo.state}</span>
															</td>
															<td>
															
															<a class="icon-remove" style="padding-left:20px ;" href="{:U('activity/studel',array('id'=>$vo['id']))}"></a>
															<input type="text" name="id" hidden="" value="{$vo.id}">
															<a class=" icon-pencil" data-toggle="modal" data-target="#myModal" onclick="update(this)"></a>
															</td>
														</tr>
														</volist>
													</tbody>
														
													
												</table>
											</div>

							<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">  
							  <div class="modal-dialog">  
							    <div class="modal-content">  
							      <div class="modal-header">  
							        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>  
							        <h4 class="modal-title">修改信息</h4>  
							      </div> 
							      <div class="modal-body">  
							      <form method="post"  class="form-horizontal" >
										<input id="stu_id" type="text" name="id" hidden="">
							      		<div class="form-group">
											<label class="control-label col-md-2"> 项目分数 </label>
											<div class="col-md-8">
												<input class="form-control" id="score"  type="text" name="score" >
											</div>
										</div>	
											<div class="form-group">
													<label class="control-label col-md-2">出勤状态  
													</label> 
														<div class="col-md-8">
														  	<select name="state" id="state" class="form-control">
												      		
												      	</select>
														</div>
											</div> 
													<div class="form-group">
															
														<div class="modal-footer">  
												        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>  
												        <button type="submit" class="btn btn-primary" id="save_data">保存</button>  
												      	</div> 
														</div>
							      </form>
							  	</div> 

							      	<script type="text/javascript">
							      	function update(o){
							      		var tr= o.parentNode.parentNode;
							      		var tds=tr.cells;
							      		var id=$(o).prev().val();
							      		var state=tds[4].innerText;
							      		var score=tds[3].innerText;
							      		$("#stu_id").val(id);
							      		$("#score").val(score);
							      		if (state=="未参加") {
							      			$("#state").html(
							      			  '<option selected="selected" value="未参加" style="display:none">未参加</option><option value="已参加">已参加</option><option value="缺 席">缺 席</option>'
							      			  );
							      		}else if(state=="已参加"){
							      			$("#state").html(
							      			  '<option selected="selected"  value="已参加">已参加</option><option value="缺 席">缺 席</option>'
							      			  );
							      		}else{
							      			$("#state").html(
							      			  '<option value="已参加">已参加</option><option selected="selected"  value="缺 席">缺 席</option>'
							      			  );
							      		}

							      	}
										 $("#save_data").click(function(){
										 	 $.ajax({
											  	type:"get",
					            				url:"__CONTROLLER__/stuedit/",
											    data: $("form:eq(0)").serialize(),
											    success: function(data) {
											    	if (data) {
											         alert("修改成功");
											     }else{
											     	alert("修改失败");
											     }
											    }
											});
										 });

										</script>
							      </div>  
							      
							    </div><!-- /.modal-content -->  
							  </div><!-- /.modal-dialog -->  
							</div>
							</div>
						</div>
						</div>
                     </div>           

                                      <div class="tab-pane" id="profile12">
                                        	<div class="col-md-12" >
                               			<div style="width: 60%;margin:30px auto">
									
										<div class="panel panel-success">
										  <div class="panel-heading" style="height:40px;font-size:20px;padding:10px;">{$list.aname}  <span style="float:right"><i class="icon-edit" ></i></span>
										  </div>

										  <div class="panel-body">

										 	 <div id="resultContent">
										  <if condition="$list['result'] eq null">
										    <p style="font-size: 24px; color:red; margin:20px auto;  text-align: center; font-family: 微软雅黑, 宋体;">
										    抱歉暂无活动结果！
											</p>

											<else/>
											{$list.result}
											</if>
												</div>

										<div id="addresult" style="display:none">
											<form method="post" id="resuledesc" class="form-horizontal" enctype="multipart/form-data">
											<!-- <input type="" name="" value="{$list.aid}"> -->
												<div class="form-group">
											<div class="col-md-12">
												<script id="intro" name="result"  value="{$list.result}" type="text/plain"></script>
													<script type="text/javascript">
						                                UE.getEditor('intro', {
						                                    theme: "default", //鐨偆
						                                    lang: "zh-cn", //璇█
						                                    initialFrameWidth: "100%", //鍒濆鍖栫紪杈戝櫒瀹藉害,榛樿800
						                                    initialFrameHeight: 500,
						                                    toolbars: [['source', 'undo', //鎾ら攢
						                                 'redo', //閲嶅仛
						                                 'bold', //鍔犵矖
						                                 'italic', //鏂滀綋
						                                 'underline', //涓嬪垝绾�
						                                 'selectall', //鍏ㄩ��
						                                 'preview', //棰勮
						                                 'horizontal', //鍒嗛殧绾�
						                                 'cleardoc', //娓呯┖鏂囨。
						                                 'fontfamily', //瀛椾綋
						                                 'fontsize', //瀛楀彿
						                                 'paragraph', //娈佃惤鏍煎紡
						                                 'simpleupload', //鍗曞浘涓婁紶
						                                 'insertimage', //澶氬浘涓婁紶
						                                 'link', //瓒呴摼鎺�
						                                 'emotion', //琛ㄦ儏
						                                 'justifyleft', //灞呭乏瀵归綈
						                                 'justifyright', //灞呭彸瀵归綈
						                                 'justifycenter', //灞呬腑瀵归綈
						                                 'justifyjustify', //涓ょ瀵归綈
						                                 'forecolor', //瀛椾綋棰滆壊
						                                 'backcolor', //鑳屾櫙鑹�
						                                 'insertorderedlist', //鏈夊簭鍒楄〃
						                                 'insertunorderedlist', //鏃犲簭鍒楄〃
						                                 'fullscreen', //鍏ㄥ睆
						                                 'imagenone', //榛樿
						                                 'imageleft', //宸︽诞鍔�
						                                 'imageright', //鍙虫诞鍔�
						                                 'imagecenter', //灞呬腑
						                                 'lineheight', //琛岄棿璺�
						                                 ]]
						                                });
						                            </script>
											</div>
										</div>
									<div class="form-group">
												<div class="modal-footer">  
												        <button type="button" class="btn btn-default" id="close">关闭</button>  
												        <button type="submit" class="btn btn-primary" id="save_result">保存</button>  
												      	</div> 
														</div>
							     		 </form>
							     		 			
											</div>
										  </div>
										</div>
									</div>
									   	<script type="text/javascript">
									   	var aid={$list.aid};
							 			$(".icon-edit").click(function(){
							 				$("#resultContent").hide();
							 				$("#addresult").show();
							 			});
							 			$("#close").click(function(){
							 				$("#resultContent").show();
							 				$("#addresult").hide();
							 			});

							 			$("#save_result").click(function(){
							 				// alert($("form:eq(1)").serialize());
							 				// alert(aid);
							 				  $.ajax({
											  	type:"get",
					            				url:"__CONTROLLER__/saveresult/aid/"+aid,
					            				data: $("form:eq(1)").serialize(),
											    success: function(data) {
											    	// alert(data);
											    	if(data==1){alert("添加成功");}
											    	else{ alert("添加失败");}
											    	 }
											});
							 			});
							
										</script>
							      </div>  
							      
							    </div><!-- /.modal-content -->  
							  </div><!-- /.modal-dialog -->  

                                </div>
                            </div>
                        </div>
                        <!-- 111111111111111111111111111111111 -->

                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>  
</body>

<include file="Public/HOME/HTML/footer.html" />
</html>
	
				

			